load("//tools:defaults.bzl", "jasmine_test", "ts_project")

package(default_visibility = ["//visibility:public"])

ts_project(
    name = "migration-utilities",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
    tsconfig = "//src/material/schematics:tsconfig",
    deps = [
        "//:node_modules/typescript",
    ],
)

ts_project(
    name = "unit_tests_lib",
    testonly = True,
    srcs = glob(["**/*.spec.ts"] + ["rules/components/test-setup-helper.ts"]),
    tsconfig = "//src/material/schematics:tsconfig-test",
    deps = [
        ":migration-utilities",
        "//:node_modules/@types/jasmine",
        "//:node_modules/typescript",
    ],
)

jasmine_test(
    name = "unit_tests",
    data = [
        ":unit_tests_lib",
        "//src/material/schematics:package_json",
    ],
)
